TrashFolder Function
Used to access the items in the Trash Can or Recycle Bin.
Syntax
result = TrashFolder
Notes
The Trash folder is represented on desktop by the Recycle Bin or Trash Can icons. When a user drags items in or out of the Recycle Bin/Trash Can, they are in fact, dragging those items in or out of the Trash folder.
The TrashFolder function provides a way to access the Trash folder that will work under different languages and operating systems.
The SpecialFolder module enables you to access many special folders that are managed by the OS.
Windows
On Windows, a call to TrashFolder returns a FolderItem that references the current user's Recycle Bin.
Macintosh
On Mac OS X, TrashFolder returns a FolderItem that references the invisible ".Trash" folder for the current user.
Linux
On Linux, TrashFolder returns a FolderItem that references the invisible ".Trash" folder for the current user. If that directory does not exist, it returns Nil.
Example
This example displays the absolute path to the user's Trash folder, if it exists on the user's machine.
f=TrashFolder
if f <> Nil Then
MsgBox f.AbsolutePath
Else
MsgBox "The folderItem does not exist."
End if
See Also
ApplicationSupportFolder, DesktopFolder, FontsFolder, PreferencesFolder, StartupItemsFolder, SystemFolder, TemporaryFolder, SpecialFolder functions.